'use strict';

const {Controller} = require('egg');
const ResponseUtil = require('../utils/ResponseUtil');
const HelperUtil = require('../utils/HelperUtil');
const StringUtil = require('../utils/StringUtil');
const Constant = require('../config/Constant');
const request = require('request');

class ProductController extends Controller {

    async getProductList() {
        const res = await this.ctx.service.product.getProductList();
        return this.ctx.body = ResponseUtil.success(res.list,res.total);
    }

    async getProductDetail(){
        const res = await this.ctx.service.product.getProductDetail();
        return this.ctx.body = ResponseUtil.success(res);
    }

    async applyProduct(){
        const res = await this.ctx.service.product.applyProduct();
        return this.ctx.body = ResponseUtil.success(res);
    }

}

module.exports = ProductController;
